HAL RAMCFG function migration

This section provides information about the HAL RAMCFG function migration.

Note

The RAMCFG handle is removed in HAL2, so for the following RAMCFG HAL2 functions, the handle will be removed from the parameters and replaced by the instance.

Related concept: Other HAL RAMCFG changes

HAL RAMCFG start ECC

HAL1

HAL2

HAL_RAMCFG_StartECC(RAMCFG_HandleTypeDef *hramcfg)
HAL_RAMCFG_ECC_Enable(hal_ramcfg_t instance)

HAL RAMCFG stop ECC

HAL1

HAL2

HAL_RAMCFG_StopECC(RAMCFG_HandleTypeDef *hramcfg)
HAL_RAMCFG_ECC_Disable(hal_ramcfg_t instance)

HAL RAMCFG configure wait state

HAL1

HAL2

HAL_RAMCFG_ConfigWaitState(RAMCFG_HandleTypeDef *hramcfg,
                           uint32_t WaitState)
HAL_RAMCFG_SetWaitState(hal_ramcfg_t instance,
                        hal_ramcfg_wait_state_t wait_state)

HAL RAMCFG disable notifications

HAL1

HAL2

HAL_RAMCFG_EnableNotification(RAMCFG_HandleTypeDef *hramcfg, uint32_t Notifications)
HAL_RAMCFG_DisableNotification(RAMCFG_HandleTypeDef *hramcfg, uint32_t Notifications)
Renamed in HAL2, as the notifications are enabled/disabled inside these functions:
HAL_RAMCFG_ECC_Enable_IT() and HAL_RAMCFG_ECC_Disable()

Related concept: Other HAL RAMCFG changes


HAL RAMCFG Enable write protection

HAL1

HAL2

HAL_RAMCFG_EnableWriteProtection(RAMCFG_HandleTypeDef *hramcfg,
                                 uint32_t StartPage,
                                 uint32_t NbPage)
HAL_RAMCFG_EnablePageWRP(hal_ramcfg_t instance,
                         uint32_t start_page,
                         uint32_t page_nbr)

HAL RAMCFG erase memory

HAL1

HAL2

In HAL1, the timeout is fixed in the source file

#define RAMCFG_TIMEOUT_VALUE 50000U

In HAL2, the user can change the timeout in the parameters of the function accordingly.

Function prototype

HAL_RAMCFG_Erase(RAMCFG_HandleTypeDef *hramcfg)
HAL_RAMCFG_MassErase(hal_ramcfg_t instance,
                     uint32_t timeout)

Example usage

/* The timeout is fixed in the source file */
#define RAMCFG_TIMEOUT_VALUE 50000U

/* Erase the SRAM memory */
if (HAL_RAMCFG_Erase(&hramcfg_SRAM1) != HAL_OK)
{
  Error_Handler();
}
/* The timeout is set as a parameter in millisecond */


/* Erases the given SRAM memory */
if (HAL_RAMCFG_MassErase(&hRAMCFG_SRAM1, 6000) != HAL_OK)
{
  Error_Handler();
}

HAL RAMCFG get wait state

HAL1

HAL2

HAL_RAMCFG_GetWaitState(const RAMCFG_HandleTypeDef *hramcfg)
HAL_RAMCFG_GetWaitState(hal_ramcfg_t instance)

HAL RAMCFG error address

All of HAL1 functions are merged into one single function in HAL2 that will return the error address and/or it’s type.

HAL1

HAL2

HAL_RAMCFG_GetSingleErrorAddress(const RAMCFG_HandleTypeDef *hramcfg)
HAL_RAMCFG_GetDoubleErrorAddress(const RAMCFG_HandleTypeDef *hramcfg)
HAL_RAMCFG_IsECCDoubleErrorDetected(const RAMCFG_HandleTypeDef *hramcfg)
HAL_RAMCFG_IsECCSingleErrorDetected(const RAMCFG_HandleTypeDef *hramcfg)
HAL_RAMCFG_ECC_GetInfo(hal_ramcfg_t instance, hal_ramcfg_ecc_info_t *p_info);